package com.zretc.testpatt;

import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.zretc.dao.NewsDaoImpl;
import com.zretc.service.NewsServiceImpl;

public class TestPhoneFactory {

	ApplicationContext context;

	@Before
	public void before() {
		context = new ClassPathXmlApplicationContext("beanFac.xml");
	}

	@Test
	public void tesHw() {

		Phone hw = context.getBean("hw", HuaWeiPhone.class);
		hw.takePhoto();
	}

	@Test
	public void testMi() {

		Phone mi = context.getBean("mi", MiPhone.class);
		mi.takePhoto();
	}

}
